<%@ page contentType="text/html" pageEncoding="UTF-8" session="false"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<c:set var="contextPath"
	value="${pageContext.servletContext.contextPath}" />
<!doctype html>
<html lang="en">
<head>
<title>Booking ${booking.id}</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="${contextPath}/styles/default.css" />
</head>
<body>
	<c:choose>
		<c:when test="${empty booking}">
			<c:import url="/WEB-INF/JSP/menu.jsp" />
			<div class="erorr">Booking not found</div>
		</c:when>
		<c:otherwise>
			<header>
				<c:import url="/WEB-INF/JSP/menu.jsp" />
				<h1>
					<c:if test="${param.created=='true'}">Booking is created: </c:if>
					Booking ${booking.id}
				</h1>
			</header>
			<h2>Trip</h2>
			<dl>
				<dt>Destination</dt>
				<dd>${booking.trip.destination.name}</dd>
				<dt>Departure location</dt>
				<dd>${booking.trip.departureLocation.name}</dd>
				<dt>Departure date</dt>
				<dd>
					<spring:eval expression="booking.trip.period.departureDate" />
				</dd>
				<dt>Arrvial date</dt>
				<dd>
					<spring:eval expression="booking.trip.period.returnDate" />
				</dd>
				<dt>Number of days</dt>
				<dd>${booking.trip.period.numberOfDays}</dd>

			</dl>
			<c:url value="/bookings" var="bookingsURL" />
			<h2>Customer</h2>
			<dl>
				<dt>Username</dt>
				<dd>${booking.customer.username}
			</dl>
			<h2>Booking</h2>
			<dl>
				<dt>Seats</dt>
				<dd>${booking.seats}
				<dt>Gross price</dt>

				<dd>
					${booking.seats} seat(s) x
					<spring:eval expression="booking.grossPricePerPerson" />
					=
					<spring:eval expression="booking.grossPrice" />
				</dd>
				<dt>Net price</dt>

				<dd>
					${booking.seats} seat(s) x
					<spring:eval expression="booking.netPricePerPerson" />
					=
					<spring:eval expression="booking.netPrice" />
				</dd>

			</dl>
		</c:otherwise>
	</c:choose>
</body>
</html>
